package net.hn.hnms.biz.plan.domain;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@ApiModel("一体化填报导入")
@ContentFontStyle(fontHeightInPoints = 15)
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 26)
@ColumnWidth(16)
@HeadRowHeight(30)
public class IntegratedReporting {

    @ApiModelProperty("id")
    @TableId(type = IdType.ASSIGN_UUID)
    @ExcelIgnore
    private String integratedReportingId;
    @ApiModelProperty("名称")
    @ExcelProperty("名称")
    private String name;
    @ApiModelProperty("单位类型（0公司/ 1煤矿）")
    @ExcelProperty("单位类型（公司/煤矿）")
    @ColumnWidth(32)
    private String type;
    @ApiModelProperty("日期")
    @ExcelProperty("日期")
    @ColumnWidth(15)
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")

    private Date date;

    @ApiModelProperty("日期:分析统计用")
    @ExcelIgnore
    private String dateStatistics;
    @ApiModelProperty("日产量")
    @ExcelProperty("日产量")
    private BigDecimal dayYield;
    @ApiModelProperty("月累计产量")
    @ExcelProperty("月累计产量")
    private BigDecimal monthYield;

    @ApiModelProperty("日剥离量")
    @ExcelProperty("日剥离量")
    private BigDecimal dayPeel;
    @ApiModelProperty("月累计剥离量")
    @ExcelProperty("月累计剥离量")
    @ColumnWidth(25)
    private BigDecimal monthPeel;

    @ApiModelProperty("日销量")
    @ExcelProperty("日销量")
    private BigDecimal daySale;

    @ApiModelProperty("电厂自用")
    @ExcelProperty("电厂自用")
    private BigDecimal salePowerPlant;

    @ApiModelProperty("北方内供")
    @ExcelProperty("北方内供")
    private BigDecimal saleNorthInterior;
    @ApiModelProperty("集团内供")
    @ExcelProperty("集团内供")
    private BigDecimal saleGroupInterior;
    @ApiModelProperty("市场煤")
    @ExcelProperty("市场煤")
    private BigDecimal saleBazaarCoal;
    @ApiModelProperty("月累计销量")
    @ExcelProperty("月累计销量")
    private BigDecimal monthSale;

    public static List<String> getAllField() {
        List<String> fields = new ArrayList<>();
        for (Field field : IntegratedReporting.class.getDeclaredFields()) {
            if (!field.getName().equals("dateStatistics")&&!field.getName().equals("integratedReportingId")) {
                fields.add(StrUtil.toUnderlineCase(field.getName()));
            }
        }
        return fields;
    }
}
